package model

type student struct {
	name string
	age int
	score float32
}

func NewStudent(name string, age int, score float32) *student {
	return &student{
		name: name,
		age: age,
		score: score,
	}
}

func (s *student) SetName(name string) {
	s.name = name
}

func (s *student) GetName() string {
	return s.name
}

type StudentSclice []student

func (ss StudentSclice) Len() int {
	return len(ss)
}

func (ss StudentSclice) Less(i, j int) bool{
	return ss[i].score > ss[j].score
}

func (ss StudentSclice) Swap(i, j int){
	ss[i], ss[j] = ss[j], ss[i]
}